import PAGE from '../../../utils/middleware/page'
import { storeBindingsBehavior } from 'mobx-miniprogram-bindings'
import store from '../../../store/index'
const app = getApp()
Page(PAGE({
    data: {
        loading: false,
        loaded: false,
        list: [],
        listField: {
            module: 'scanParking',
            api: 'PageList'
        },
        searchParams: {
            PageIndex: 1,
            PageSize: 15,
            Status: null
        },

    },
    onLoad(options) {
        if (options[0]) {
            this.data.searchParams.Status = options[0]
        }
        this.init()
    },
    onPullDownRefresh() {
        this.setData({ list: [] });
        this.init();
        wx.stopPullDownRefresh();
    },
    onReachBottom() {
        if (this.data.loaded) return;
        this.fetchList();
    },
    init() {
        this.data.searchParams.PageIndex = 1;
        this.fetchList();

    },
    async fetchList() {
        this.handleFetchListData({}, 'listField', this.data.searchParams.PageIndex == 1)
    },
}))